<?php
/**----------------------------------------------------------------------
 * Purpose： Project Class
 * 
 * CreateDate : 2014/07/29
 * Description：
 * 		Manage Projects
 * 
 * @package		C-UNIT Class
 * @author	 	C-UNIT SQUARE Co.,Ltd. <info@c-unit.co.jp>
 * @copyright  	Copyright(c) 2014　C-UNIT SQUARE Co.,Ltd. All Rights Reserved.
 * @license		C-UNIT SQUARE Co.,Ltd.
 ------------------------------------------------------------------------*/
class Backyard_Bootstrap extends Zend_Application_Module_Bootstrap
{
	/**-------------------------------------------------------------------
	 * Init autoload
	 --------------------------------------------------------------------*/
	protected function _initAutoload(){
        $objAutoloader = new Zend_Application_Module_Autoloader(array(
																'namespace' => '',
																'basePath' => dirname(__FILE__),
															));
		
        return $objAutoloader;
    }

    /**-------------------------------------------------------------------
	 * Init rewrite URL
	 --------------------------------------------------------------------*/
    protected function _initFrontController(){
        $front = Zend_Controller_Front::getInstance();       
        $front->addControllerDirectory(APPLICATION_PATH . "/modules/default/backyard/controllers");
           
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routers.ini', 'user');
        $router = new Zend_Controller_Router_Rewrite();
          
        $router = $router->addConfig($config, 'routes');
          
        $front->setRouter($router);

        // action Detail
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routers.ini', 'detail');
        $router = $router->addConfig($config, 'routes');
        $front->setRouter($router);
                          
        return $front;  
    }
}
